/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.cspimp.project.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://docs.auauz.net
* @description /
* @author 黄星星
* @date 2020-05-24
**/
@Entity
@Data
@Table(name="p_project")
public class Project implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private Long id;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建者")
    private String createBy;

    @Column(name = "update_by")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @Column(name = "name")
    @ApiModelProperty(value = "项目名称")
    private String name;

    @Column(name = "app_id")
    @ApiModelProperty(value = "app id")
    private String appId;

    @Column(name = "app_key")
    @ApiModelProperty(value = "app key")
    private String appKey;

    @Column(name = "map_id")
    @ApiModelProperty(value = "地图ID")
    private String mapId;

    @Column(name = "title_id")
    @ApiModelProperty(value = "主题ID")
    private String titleId;

    @Column(name = "map_app_id")
    @ApiModelProperty(value = "地图APP ID")
    private String mapAppId;

    @Column(name = "map_app_key")
    @ApiModelProperty(value = "地图app key")
    private String mapAppKey;

    @Column(name = "initiallization_angle")
    @ApiModelProperty(value = "初始化角度")
    private String initiallizationAngle;

    @Column(name = "map_scaling_angle")
    @ApiModelProperty(value = "地图缩放比例")
    private String mapScalingAngle;

    @Column(name = "location_start_point_pre")
    @ApiModelProperty(value = "定位起点开始")
    private String locationStartPointPre;

    @Column(name = "location_start_point_end")
    @ApiModelProperty(value = "定位起点结束")
    private String locationStartPointEnd;

    @Column(name = "location_end_point_pre")
    @ApiModelProperty(value = "定位终点开始")
    private String locationEndPointPre;

    @Column(name = "location_end_point_end")
    @ApiModelProperty(value = "定位终点结束")
    private String locationEndPointEnd;

    @Column(name = "left_up_pre")
    @ApiModelProperty(value = "左上坐标开始")
    private String leftUpPre;

    @Column(name = "left_up_end")
    @ApiModelProperty(value = "左上坐标结束")
    private String leftUpEnd;

    @Column(name = "right_up_pre")
    @ApiModelProperty(value = "右上坐标开始")
    private String rightUpPre;

    @Column(name = "right_up_end")
    @ApiModelProperty(value = "右上坐标结束")
    private String rightUpEnd;

    @Column(name = "left_down_pre")
    @ApiModelProperty(value = "左下坐标开始")
    private String leftDownPre;

    @Column(name = "left_down_end")
    @ApiModelProperty(value = "坐下坐标结束")
    private String leftDownEnd;

    @Column(name = "right_down_pre")
    @ApiModelProperty(value = "右下坐标开始")
    private String rightDownPre;

    @Column(name = "right_down_end")
    @ApiModelProperty(value = "右下坐标结束")
    private String rightDownEnd;

    @Column(name = "map_resource_url")
    @ApiModelProperty(value = "地图资源地址")
    private String mapResourceUrl;

    @Column(name = "location_area")
    @ApiModelProperty(value = "定位区域")
    private String locationArea;

    public void copy(Project source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}